<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>usbps: xusbps_audio_example.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">usbps
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="pages.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xusbps__audio__example_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xusbps_audio_example.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>This file contains the implementation of chapter 9 specific code for the example. </p>
<pre>
MODIFICATION HISTORY:</pre><pre>Ver   Who       Date     Changes
</p>
<hr/>
<p>
1.0   pm        20/02/20 First release
2.8   pm        07/07/23 Added support for system device-tree flow.</pre><pre></pre> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a151422305b638ea9418bbd8d0639f93d"><td class="memItemLeft" align="right" valign="top">s32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusbps__audio__example_8c.html#a151422305b638ea9418bbd8d0639f93d">XUsbPs_CfgInit</a> (struct Usb_DevData *InstancePtr, <a class="el" href="struct_x_usb_ps___config.html">Usb_Config</a> *ConfigPtr, u32 BaseAddress)</td></tr>
<tr class="memdesc:a151422305b638ea9418bbd8d0639f93d"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function initializes a <a class="el" href="struct_x_usb_ps.html" title="The XUsbPs driver instance data. ">XUsbPs</a> instance/driver.  <a href="#a151422305b638ea9418bbd8d0639f93d">More...</a><br/></td></tr>
<tr class="separator:a151422305b638ea9418bbd8d0639f93d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a938cd4fd3524f466825dbd96299426e5"><td class="memItemLeft" align="right" valign="top">s32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusbps__audio__example_8c.html#a938cd4fd3524f466825dbd96299426e5">XUsbPs_SetupInterruptSystem</a> (<a class="el" href="struct_x_usb_ps.html">XUsbPs</a> *InstancePtr, u16 IntcDeviceID, XScuGic *IntcInstancePtr)</td></tr>
<tr class="memdesc:a938cd4fd3524f466825dbd96299426e5"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function setups the interrupt system such that interrupts can occur.  <a href="#a938cd4fd3524f466825dbd96299426e5">More...</a><br/></td></tr>
<tr class="separator:a938cd4fd3524f466825dbd96299426e5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusbps__audio__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
<tr class="memdesc:a840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is the main function of the USB audio example.  <a href="#a840291bc02cba5474a4cb46a9b9566fe">More...</a><br/></td></tr>
<tr class="separator:a840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a840291bc02cba5474a4cb46a9b9566fe"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int main </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is the main function of the USB audio example. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">None</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if successful,</li>
<li>XST_FAILURE if unsuccessful.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="struct_x_usb_ps___config.html#a0fc8018ea01456a111464cf7d9f7ed04">XUsbPs_Config::BaseAddress</a>, <a class="el" href="struct_x_usb_ps___ep_setup.html#a256d341fe10df4647516600022afa2a3">XUsbPs_EpSetup::BufSize</a>, <a class="el" href="struct_x_usb_ps___device_config.html#a0a5c8ac8a91e6d08ee7c74e6b1d7ad0e">XUsbPs_DeviceConfig::DMAMemPhys</a>, <a class="el" href="struct_x_usb_ps___device_config.html#afd60a9334300a134f4027be0bef9c6c4">XUsbPs_DeviceConfig::EpCfg</a>, <a class="el" href="struct_x_usb_ps___ep_config.html#adf5b934788f53cbdb6c23371c0e88e53">XUsbPs_EpConfig::In</a>, <a class="el" href="struct_x_usb_ps___ep_setup.html#ab6896a844582da8978f89a4245c055a9">XUsbPs_EpSetup::MaxPacketSize</a>, <a class="el" href="struct_x_usb_ps___ep_setup.html#a55577027dc17083887a0fd818a80f453">XUsbPs_EpSetup::NumBufs</a>, <a class="el" href="struct_x_usb_ps___device_config.html#aeb059166762916b8b5776f4afba26315">XUsbPs_DeviceConfig::NumEndpoints</a>, <a class="el" href="struct_x_usb_ps___ep_config.html#afb05276ac16ab82fc798fdb0cb2ed3b5">XUsbPs_EpConfig::Out</a>, <a class="el" href="struct_x_usb_ps___ep_setup.html#a3d73546dc7146b2695f001901763bff9">XUsbPs_EpSetup::Type</a>, <a class="el" href="xusbps__audio__example_8c.html#a151422305b638ea9418bbd8d0639f93d">XUsbPs_CfgInit()</a>, <a class="el" href="group__usbps.html#ga6daace32113a806a6822a6d5943a93f4">XUsbPs_ConfigureDevice()</a>, <a class="el" href="group__usbps.html#ga0f21b0f7da084c22abc4f0a9bf425bc7">XUSBPS_EP_DIRECTION_IN</a>, <a class="el" href="group__usbps.html#ga86e363bb35c38123a924bd2af954ceab">XUSBPS_EP_DIRECTION_OUT</a>, <a class="el" href="group__usbps.html#gad8b727ed129801690a987d1e475bc1d5">XUSBPS_EP_TYPE_CONTROL</a>, <a class="el" href="group__usbps.html#gae012590baed99e88cd4a92ff3f65faa0">XUSBPS_EP_TYPE_ISOCHRONOUS</a>, <a class="el" href="group__usbps.html#ga04fb0b564bcd01cdf33e29ca2732656a">XUsbPs_EpSetHandler()</a>, <a class="el" href="group__usbps.html#ga5eb603906d381d4a426a3d24fc2082a0">XUsbPs_EpSetIsoHandler()</a>, <a class="el" href="xusbps_8h.html#af88d5cf6ea7f26426bf40b8ca330a416">XUsbPs_IntrEnable</a>, <a class="el" href="group__usbps.html#ga60e2b0f6fabc24cdf785d704ab2585d1">XUsbPs_IntrHandler()</a>, <a class="el" href="group__usbps.html#ga6dcda0bc8640b4ab5cc9640fdfaead17">XUSBPS_IXR_UI_MASK</a>, <a class="el" href="group__usbps.html#ga8c0544cefd69591cbf14e39dab946bd0">XUSBPS_IXR_UR_MASK</a>, <a class="el" href="group__usbps.html#gafcaf2c53431ef206d3435d677867f818">XUsbPs_LookupConfig()</a>, <a class="el" href="xusbps__audio__example_8c.html#a938cd4fd3524f466825dbd96299426e5">XUsbPs_SetupInterruptSystem()</a>, and <a class="el" href="xusbps_8h.html#af222df779ee9f9dc1d681701a979f3d1">XUsbPs_Start</a>.</p>

</div>
</div>
<a class="anchor" id="a151422305b638ea9418bbd8d0639f93d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">s32 XUsbPs_CfgInit </td>
          <td>(</td>
          <td class="paramtype">struct Usb_DevData *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_x_usb_ps___config.html">Usb_Config</a> *&#160;</td>
          <td class="paramname"><em>ConfigPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>BaseAddress</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function initializes a <a class="el" href="struct_x_usb_ps.html" title="The XUsbPs driver instance data. ">XUsbPs</a> instance/driver. </p>
<p>The initialization entails:</p>
<ul>
<li>Initialize all members of the <a class="el" href="struct_x_usb_ps.html" title="The XUsbPs driver instance data. ">XUsbPs</a> structure.</li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to <a class="el" href="struct_x_usb_ps.html" title="The XUsbPs driver instance data. ">XUsbPs</a> instance of the controller. </td></tr>
    <tr><td class="paramname">ConfigPtr</td><td>is a pointer to a <a class="el" href="struct_x_usb_ps___config.html" title="The XUsbPs_Config structure contains configuration information for the USB controller. ">XUsbPs_Config</a> configuration structure. This structure will contain the requested configuration for the device. Typically, this is a local structure and the content of which will be copied into the configuration structure within <a class="el" href="struct_x_usb_ps.html" title="The XUsbPs driver instance data. ">XUsbPs</a>. </td></tr>
    <tr><td class="paramname">BaseAddress</td><td>is the base address of the device.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS no errors occurred.</li>
<li>XST_FAILURE an error occurred during initialization.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd></dd></dl>

<p>References <a class="el" href="group__usbps.html#ga1a3417695facf9eff86ce6a1e14a9bbc">XUsbPs_CfgInitialize()</a>.</p>

<p>Referenced by <a class="el" href="xusbps__audio__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main()</a>.</p>

</div>
</div>
<a class="anchor" id="a938cd4fd3524f466825dbd96299426e5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">s32 XUsbPs_SetupInterruptSystem </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_usb_ps.html">XUsbPs</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>IntcDeviceID</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">XScuGic *&#160;</td>
          <td class="paramname"><em>IntcInstancePtr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function setups the interrupt system such that interrupts can occur. </p>
<p>This function is application specific since the actual system may or may not have an interrupt controller. The USB controller could be directly connected to aprocessor without an interrupt controller. The user should modify this function to fit the application.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the <a class="el" href="struct_x_usb_ps.html" title="The XUsbPs driver instance data. ">XUsbPs</a> instance. </td></tr>
    <tr><td class="paramname">IntcDeviceID</td><td>is the unique ID of the interrupt controller </td></tr>
    <tr><td class="paramname">IntcInstacePtr</td><td>is a pointer to the interrupt controller instance.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>XST_SUCCESS if successful, otherwise XST_FAILURE.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="xusbps_8h.html#af88d5cf6ea7f26426bf40b8ca330a416">XUsbPs_IntrEnable</a>, <a class="el" href="group__usbps.html#ga60e2b0f6fabc24cdf785d704ab2585d1">XUsbPs_IntrHandler()</a>, <a class="el" href="group__usbps.html#ga6dcda0bc8640b4ab5cc9640fdfaead17">XUSBPS_IXR_UI_MASK</a>, and <a class="el" href="group__usbps.html#ga8c0544cefd69591cbf14e39dab946bd0">XUSBPS_IXR_UR_MASK</a>.</p>

<p>Referenced by <a class="el" href="xusbps__audio__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
